<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Demo</title>
  <style>
    #container {
      position: relative;
      margin: 0;
      padding: 0;
      width: 400px;
      height: 400px;
      background: black;
    }
  </style>
</head>
<body>
  <div id="container"></div>
  <script src="/js/spritejs.js"></script>
  <script>
    (async function(){
      const imgUrl = 'https://s5.ssl.qhres.com/static/ec9f373a383d7664.svg'
      const paper = spritejs.Paper2D('#container')
      //paper.setResolution(400, 400)

      const render = {textures: {}}

      const sprite = new spritejs.Sprite()
      sprite.attr({
        textures: [imgUrl],
        bgcolor: '#fff',
        //anchor: [0.5, 0.5],
        pos: [0, 0],
        size: [400, 400],
        borderRadius: '200'
      })

      window.s = sprite
      
      paper.layer().appendChild(sprite)

      window.paper = paper
    })()  
  </script>
</body>
</html>